package com.meritdata.cloud.data.datasource.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.meritdata.cloud.data.base.Page;
import com.meritdata.cloud.data.datasource.dao.IDatasourceDao;
import com.meritdata.cloud.data.datasource.model.Datasource;
import com.meritdata.cloud.data.datasource.service.IDatasourceService;

@Service
public class DatasourceService implements IDatasourceService {
	
	@Autowired
	private IDatasourceDao dao;

	@Override
	public void add(Datasource datasource) {
		dao.save(datasource);
	}

	@Override
	public Page page(Page page) {
		return dao.pageHql("from Datasource", page.getPageNum(), page.getPageSize(), null);
	}

}
